<?php
declare (strict_types=1);

namespace app\api\model\yuql;

use think\Model;

/**
 * @mixin \think\Model
 */
class Cashe extends Model
{
    protected $table = '2008a_store_cashe';

    /**
     * yuql
     * 查询选择周、月、年对应时间内的数据
     * @param $created_time
     * @param $data
     * @return array
     */
    public static function cashesBetTime($created_time, $data, $fieldOrder)
    {
        $result = Cashe::whereBetween($created_time, $data)
            ->paginate(10)
            ->order($fieldOrder, 'desc')
            ->toArray();
        return $result;
    }
}
